package com.tq.teaching_quality.controller;


import com.tq.teaching_quality.entity.SurveyAnswerSheetDetail;
import com.tq.teaching_quality.service.SurveyAnswerSheetDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 问卷答卷明细 前端控制器
 * </p>
 *
 * @author YTH
 * @since 2020-06-29
 */
@RestController
@RequestMapping("/survey-answer-sheet-detail")
public class SurveyAnswerSheetDetailController {

    @Autowired
    private SurveyAnswerSheetDetailService SurveyAnswerSheetDetailService;

    //增加一条记录
    @RequestMapping("/AddSurveyAnswerSheetDetail")
    public boolean AddSurveyAnswerSheetDetail(@PathVariable("SurveyAnswerSheetDetail") SurveyAnswerSheetDetail SurveyAnswerSheetDetail){
        return SurveyAnswerSheetDetailService.save(SurveyAnswerSheetDetail);
    }

    //删除一条记录
    @RequestMapping("/DeleteSurveyAnswerSheetDetail")
    public boolean DeleteSurveyAnswerSheetDetail(@PathVariable("SurveyAnswerSheetDetailId") Long SurveyAnswerSheetDetailId){
        return SurveyAnswerSheetDetailService.removeById(SurveyAnswerSheetDetailId);
    }

    //查询全部记录
    @RequestMapping("/SelectAllSurveyAnswerSheetDetail")
    public List<SurveyAnswerSheetDetail> SelectAllSurveyAnswerSheetDetail(){
        return SurveyAnswerSheetDetailService.list();
    }

    //修改一条记录
    @RequestMapping("/UpdateSurveyAnswerSheetDetail")
    public boolean UpdateSurveyAnswerSheetDetail(@PathVariable("SurveyAnswerSheetDetail") SurveyAnswerSheetDetail SurveyAnswerSheetDetail){
        return SurveyAnswerSheetDetailService.updateById(SurveyAnswerSheetDetail);
    }

}

